package com.chenbei.controller.admin.erp;

import com.chenbei.common.domain.vo.ApiResponse;
import com.chenbei.common.util.ApiResponseUtil;
import com.chenbei.erp.service.impl.InventoryOrderService;
import com.chenbei.erp.vo.req.InStorageReq;
import com.chenbei.erp.vo.req.OutStorageReq;
import com.chenbei.erp.vo.req.SchedulingStorageReq;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "WMS-仓库订单管理")
@RestController("WMSInventoryOrder")
@RequestMapping("/admin/erp/inventoryOrder")
public class InventoryOrderController {

    @Autowired
    private InventoryOrderService InventoryOrderService;

    @Operation(summary = "入库")
    @PostMapping("inbound")
    public ApiResponse<Boolean> inbound(@RequestBody @Valid InStorageReq InStorageReq) {
        InventoryOrderService.inbound(InStorageReq);
        return ApiResponseUtil.success(true);
    }

    @Operation(summary = "出库")
    @PostMapping("outbound")
    public ApiResponse<Boolean> outbound(@RequestBody @Valid OutStorageReq OutStorageReq) {
        InventoryOrderService.outbound(OutStorageReq);
        return ApiResponseUtil.success(true);
    }

    @Operation(summary = "调度")
    @PostMapping("scheduling")
    public ApiResponse<Boolean> scheduling(@RequestBody @Valid SchedulingStorageReq SchedulingStorageReq) {
        InventoryOrderService.scheduling(SchedulingStorageReq);
        return ApiResponseUtil.success(true);
    }
}
